<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateInvoicesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('invoices', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('member_id')->unsgined()->index()->comment('用户 ID');
            $table->tinyInteger('type')->unsigned()->comment('发票类型，目前为止：1 普通发票 2 增值税发票');
            $table->string('subject')->comment('对于个人发票为个人名称，单位则为单位名称');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('invoices');
    }
}
